#ifndef _Maison_h
#define _Maison_h

#include "Arduino.h"
#include <OneWire.h>
#include "send_fr.h"

#define nb_chauffages 7
#define nb_sondes 4
#define nb_pieces 6

// librairie pour capteur OneWire



class Chauffage
{
public:
  Chauffage();
  unsigned long RF_interrupteur;
  byte group;
  byte relay;
};

class Sonde
{
public:
  Sonde();
  byte type_sonde;
  byte adresse_sonde[8];
  long unsigned last_update ;
  int temperature; //En 100e
  int correction;

};

class Piece
{
public:
  Piece();
  String Nom;
  int numero_sonde;
  int target_temp;
  int v_chauf;
};

class Maison
{
public:
  Maison();
  Chauffage list_chauffages[nb_chauffages];
  Piece list_pieces[nb_pieces];
  Sonde list_sondes[nb_sondes];
  byte read_conf(byte num_file_conf,unsigned long est_sec);
  void get_temp_rf(OneWire capteur,unsigned long est_sec);
  int get_temp_old2(byte numero_chauffage, unsigned long est_sec);
  int get_temp_piece(byte numero_chauffage, unsigned long est_sec);
  void set_rf_temp(int adresse,int temp,unsigned long est_sec );
  int last_temp2(byte numero_chauffage);
  void set_chauffage(byte Num,unsigned long RF ,byte group, byte relay);
  void group_target( byte Group, int target);
  void group_target(  int target) ;
  void conf_chauffage(unsigned long est_sec);
  void chauf_on(byte Num_chauffage);
  void chauf_off(byte Num_chauffage);
  byte get_relay(byte relay, unsigned long  est_sec);

};

#endif /* _Time_h */




